// import com.alibaba.druid.DbType;
// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.statement.SQLAlterStatement;
// import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;

// import java.util.HashMap;
// import java.util.Map;

#include "MySqlCreateExternalCatalogStatement.h"
#include "../../../../../DbType.h"
#include "../../../../ast/SQLName.h"
#include "../../visitor/MySqlASTVisitor.h"

MySqlCreateExternalCatalogStatement::MySqlCreateExternalCatalogStatement()
{
  setDbType(DbType_ptr(new DbType(&DbType::mysql)));
  properties = std::make_shared<std::map<SQLName_ptr, SQLName_ptr>>();
}

SQLName_ptr MySqlCreateExternalCatalogStatement::getName()
{
  return name;
}

void MySqlCreateExternalCatalogStatement::setName(SQLName_ptr name)
{
  if (name != nullptr)
  {
    name->setParent(SharedObject(MySqlCreateExternalCatalogStatement));
  }
  this->name = name;
}

SQLName_ptr MySqlCreateExternalCatalogStatement::getComment()
{
  return comment;
}

void MySqlCreateExternalCatalogStatement::setComment(SQLName_ptr comment)
{
  if (comment != nullptr)
  {
    comment->setParent(SharedObject(MySqlCreateExternalCatalogStatement));
  }
  this->comment = comment;
}

std::shared_ptr<std::map<SQLName_ptr, SQLName_ptr>> MySqlCreateExternalCatalogStatement::getProperties()
{
  return properties;
}

BOOL_ptr MySqlCreateExternalCatalogStatement::isIfNotExists()
{
  return ifNotExists;
}

void MySqlCreateExternalCatalogStatement::setIfNotExists(BOOL_ptr ifNotExists)
{
  this->ifNotExists = ifNotExists;
}

void MySqlCreateExternalCatalogStatement::accept0(MySqlASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(MySqlCreateExternalCatalogStatement)))
  {
    acceptChild(visitor, name);
    acceptChild(visitor, comment);
  }
  visitor->endVisit(SharedObject(MySqlCreateExternalCatalogStatement));
}
